/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package vn.support.ui.action;

import java.awt.Desktop;
import java.awt.event.ActionEvent;
import java.net.URI;
import javax.swing.AbstractAction;

/**
 *
 * @author nttuyen
 */
public class BrowserAction extends AbstractAction {

    /**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private final String url;

    public BrowserAction(String name, String url) {
        super(name);
        this.url = url;
    }

    @Override
    public void actionPerformed(ActionEvent e) {
        try {
            URI uri = new URI(this.url);
            Desktop.getDesktop().browse(uri);
        } catch (Exception ex) {
            
        }
    }

}
